<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>地址栏</title>
    <script>
        function f1(){
            let url = window.location;
            console.log(url)
            console.log("当前浏览器地址栏的地址为:"+location.href);
            // 当修改了href属性值之后,即表示修改了浏览器地址的地址
            // 而当浏览器地址栏的地址发生改变之后,页面会刷新到对应地址
            // 相当于页面的跳转
            location.href = "41-消息框.html";
        }
        function f2(){
            let opener = window.opener;
            console.log(opener.location.href);
            opener.location.href = "26-表格练习.html";
        }
        function f3(){
            let parent = window.parent;
            console.log(parent.location.href);
            parent.location.href = "39-window对象.html";
        }
    </script>
</head>
<body>
<button onclick="f1()">当前地址</button><br>
<button onclick="f2()">打开该窗口的窗口</button><br>
<button onclick="f3()">父窗口</button><br>
</body>
</html>